#include <iostream>
#include <vector>
#include <unordered_map>
#include <string>
using namespace std;

class Solution
{
public:
    vector<string> uncommonFromSentences(string s1, string s2)
    {
        unordered_map<string, int> mp;
        int cnt = 0;
        string tmp;
        for (int i = 0; i < s1.size(); i++)
        {
            if (s1[i] == ' ')
            {
                mp[tmp]++;
                tmp.clear();
                i++;
            }
            
            tmp += s1[i];
        }
        mp[tmp]++;

        tmp.clear();
        for (int i = 0; i < s2.size(); i++)
        {
            if (s2[i] == ' ')
            {
                mp[tmp]++;
                tmp.clear();
                i++;
            }
            tmp += s2[i];
        }
        mp[tmp]++;

        vector<string> vs;
        
        for (auto e : mp)
        {
            if (e.second == 1)
            {
                vs.emplace_back(e.first);
            }
        }

        return vs;
    }
};

int main()
{
    string s1{ "mqk g g" };
    string s2{ "uuz rk uuz" };
    Solution xz;

    vector<string> vs = xz.uncommonFromSentences(s1, s2);

    for (auto e : vs)
    {
        cout << e << endl;
    }
    return 0;
}